﻿using System;
using System.Linq;
using System.Collections.Generic;

namespace SPCAFContrib.Entities.Consts
{
    public static partial class TypeInfo
    {
        public class SPFeature
        {
            public string Title { get; set; }
            public Guid Id { get; set; }
        }

        public static List<SPFeature> SPFeatures = new List<SPFeature>()
        {
            new SPFeature {Title = "PublishingResources", Id = new Guid("aebc918d-b20f-4a11-a1db-9ed84d79c87e")},
            new SPFeature {Title = "PublishingPrerequisites", Id = new Guid("a392da98-270b-4e85-9769-04c0fde267aa")},
            new SPFeature {Title = "PublishingLayouts", Id = new Guid("d3f51be2-38a8-4e44-ba84-940d35be1566")},
            new SPFeature
            {
                Title = "PublishingB2TRSiteFilesUpgrade",
                Id = new Guid("fd3dd145-e35e-4871-9a6d-bf17f28a1c19")
            },
            new SPFeature
            {
                Title = "PublishingB2TRHop2SiteFilesUpgrade",
                Id = new Guid("24d7018d-bf48-4813-a28d-dbf3dba173b1")
            },
            new SPFeature {Title = "Publishing", Id = new Guid("22a9ef51-737b-4ff2-9346-694633fe4416")},
            new SPFeature {Title = "ProductCatalogResources", Id = new Guid("409d2feb-3afb-4642-9462-f7f426a0f3e9")},
            new SPFeature {Title = "PublishingTimerJobs", Id = new Guid("20477d83-8bdb-414e-964b-080637f7d99b")},
            new SPFeature {Title = "ViewFormPagesLockDown", Id = new Guid("7c637b23-06c4-472d-9a9a-7c175762c5c4")},
            new SPFeature {Title = "Navigation", Id = new Guid("89e0306d-453b-4ec5-8d68-42067cdbf98e")},
            new SPFeature {Title = "NavigationProperties", Id = new Guid("541f5f57-c847-4e16-b59a-b31e90e6f9ea")},
            new SPFeature {Title = "LeftNavigation", Id = new Guid("541f5f57-c847-4e16-b59a-b31e90e6f9ea")},
            new SPFeature {Title = "SpellChecking", Id = new Guid("612d671e-f53d-4701-96da-c3a4ee00fdc5")},
            new SPFeature {Title = "EnhancedHtmlEditing", Id = new Guid("81ebc0d6-8fb2-4e3f-b2f8-062640037398")},
            new SPFeature {Title = "SearchEngineOptimization", Id = new Guid("17415b1d-5339-42f9-a10b-3fef756b84d1")},
            new SPFeature {Title = "XmlSitemap", Id = new Guid("77fc9e13-e99a-4bd3-9438-a3f69670ed97")},
            new SPFeature {Title = "Deployment", Id = new Guid("ca2543e6-29a1-40c1-bba9-bd8510a4c17b")},
            new SPFeature {Title = "TenantAdminDeploymentLinks", Id = new Guid("99f380b4-e1aa-4db0-92a4-32b15e35b317")},
            new SPFeature {Title = "AssetLibrary", Id = new Guid("4bcccd62-dcaf-46dc-a7d4-e38277ef33f4")},
            new SPFeature {Title = "VideoAndRichMedia", Id = new Guid("6e1e5426-2ebd-4871-8027-c5ca86371ead")},
            new SPFeature {Title = "MediaWebPart", Id = new Guid("5b79b49a-2da6-4161-95bd-7375c1995ef9")},
            new SPFeature {Title = "HtmlDesign", Id = new Guid("a4c654e4-a8da-4db3-897c-a386048f7157")},
            new SPFeature {Title = "PublishingMobile", Id = new Guid("57cc6207-aebf-426e-9ece-45946ea82e4a")},
            new SPFeature {Title = "OfficePublishingSite", Id = new Guid("f6924d36-2fa8-4f0b-b16d-06b7250180fa")},
            new SPFeature {Title = "OfficePublishingWeb", Id = new Guid("94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb")},
            new SPFeature {Title = "EnhancedTheming", Id = new Guid("068bc832-4951-11dc-8314-0800200c9a66")},
            new SPFeature {Title = "OfficeServerBaseSite", Id = new Guid("b21b090c-c796-4b0f-ac0f-7ef1659c20ae")},
            new SPFeature {Title = "OfficeServerBaseWeb", Id = new Guid("99fe402e-89a0-45aa-9163-85342e865dc8")},
            new SPFeature {Title = "V2VPublishedLinks", Id = new Guid("f63b7696-9afc-4e51-9dfd-3111015e9a60")},
            new SPFeature {Title = "Holds", Id = new Guid("9e56487c-795a-4077-9425-54a1ecb84282")},
            new SPFeature {Title = "Routing", Id = new Guid("7ad5272a-2694-4349-953e-ea5ef290e97c")},
            new SPFeature {Title = "RoutingResources", Id = new Guid("0c8a9a47-22a9-4798-82f1-00e62a96006e")},
            new SPFeature {Title = "RollupPages", Id = new Guid("dffaae84-60ee-413a-9600-1cf431cf0560")},
            new SPFeature {Title = "SmallBusinessWebsite", Id = new Guid("48c33d5d-acff-4400-a684-351c2beda865")},
            new SPFeature
            {
                Title = "MetadataNavigationAndFiltering",
                Id = new Guid("7201d6a4-a5d3-49a1-8c19-19c4bac6e668")
            },
            new SPFeature {Title = "SearchDrivenContent", Id = new Guid("592ccb4a-9304-49ab-aab1-66638198bb58")},
            new SPFeature {Title = "CrossSitePublishing", Id = new Guid("151d22d9-95a8-4904-a0a3-22e4db85d1e0")},
            new SPFeature {Title = "SiteServicesAddins", Id = new Guid("b21c5a20-095f-4de2-8935-5efde5110ab3")},
            new SPFeature {Title = "ContentDeploymentSource", Id = new Guid("cd1a49b0-c067-4fdd-adfe-69e6f5022c1a")},
            new SPFeature
            {
                Title = "SearchTaxonomyRefinementWebParts",
                Id = new Guid("67ae7d04-6731-42dd-abe1-ba2a5eaa3b48")
            },
            new SPFeature
            {
                Title = "SearchTaxonomyRefinementWebPartsHtml",
                Id = new Guid("8c34f59f-8dfb-4a39-9a08-7497237e3dc4")
            }
        };

        public static string GetBuiltInFeatureId(Guid value)
        {
            string result = String.Empty;

            var feature = SPFeatures.FirstOrDefault(key => key.Id == value);

            if (feature != null)
                result = feature.Title;

            return result;
        }
    }
}
